package edu.ucsd.db.bassarisk.query.bindingtree.visitor;

import edu.ucsd.db.bassarisk.query.BindingTreeQuery.BindingQueryTransformReturn;
import edu.ucsd.db.bassarisk.query.bindingtree.BindingTreeElements.BindingTreeEdge;
import edu.ucsd.db.bassarisk.query.bindingtree.BindingTreeElements.BindingTreeElement;
import edu.ucsd.db.bassarisk.query.bindingtree.BindingTreeElements.ChoiceNode;
import edu.ucsd.db.bassarisk.query.bindingtree.BindingTreeElements.EstablishingNode;

public class BindingTreeMinimizationTransformation implements
    BindingTreeVisitor<BindingQueryTransformReturn, Void> {
  private final BindingTreeEdge preTranformAnswerRoot;
  private BindingTreeEdge postTransformAnswerRoot;

  public BindingTreeMinimizationTransformation(BindingTreeEdge preTranformAnswerRoot) {
    this.preTranformAnswerRoot = preTranformAnswerRoot;
  }

  @Override
  public BindingQueryTransformReturn visitBindingTreeEdge(BindingTreeEdge edge,
                                                          Void args) {
    // TODO Auto-generated method stub
    return null;
  }

  @Override
  public BindingQueryTransformReturn visitChoiceNode(ChoiceNode choices, Void args) {
    // TODO Auto-generated method stub
    return null;
  }

  @Override
  public BindingQueryTransformReturn visitEstablishingNode(EstablishingNode node,
                                                           Void args) {
    // TODO Auto-generated method stub
    return null;
  }
  
  private BindingQueryTransformReturn returns(final BindingTreeElement transformed) {
    return new BindingQueryTransformReturn() {

      @Override
      public BindingTreeElement getTransformationRoot() {
        return transformed;
      }

      @Override
      public BindingTreeEdge getAnswerRoot() {
        return postTransformAnswerRoot;
      }
      
    };
  }
}
